This project is a Flask-based web application for managing CVE (Common Vulnerabilities and Exposures) records. It allows users to add, retrieve, update, and delete CVE records through a RESTful API.
This application provides an interface to manage CVE records stored in an SQLite database. The data is initially loaded from a CSV file.
- Python 3.x
pip(Python package installer)
-
Clone the repository:
git clone https://github.com/hilalibrahim/SecOps.git cd SecOps -
Install the required packages:
pip install Flask
-
Import the data from the CSV file:
Ensure
CVE_DATABASE.csvis in the same directory asimport_data.py.python import_data.py
-
Ensure
cve_database.dbis in the same directory asapp.py. -
Run the Flask application:
python app.py
The application will be available at
http://127.0.0.1:5000/.
-
Retrieve a specific CVE by ID:
- GET
/cve/<cve_id> - Example:
GET /cve/CVE-2021-1234 - Response: Details of the specified CVE or an error message if not found.
- GET
-
Retrieve all CVEs:
- GET
/cve/all - Example:
GET /cve/all - Response: A list of all CVEs.
- GET
-
Add a new CVE:
- POST
/cve/addCVE - Request Body:
{ "cve_id": "CVE-2021-1234", "description": "Description of the CVE", "severity": "High", "cvss": 7.5, "affected_packages": "package1, package2", "cwe_id": "CWE-79" } - Response: Confirmation message.
- POST
-
Delete a CVE by ID:
- DELETE
/cve/<cve_id> - Example:
DELETE /cve/CVE-2021-1234 - Response: Confirmation message or an error message if not found.
- DELETE
-
Update a CVE by ID:
- PUT
/cve/<cve_id> - Request Body:
{ "description": "Updated description", "severity": "Medium", "cvss": 5.0, "affected_packages": "package1, package3", "cwe_id": "CWE-89" } - Example:
PUT /cve/CVE-2021-1234 - Response: Confirmation message or an error message if not found.
- PUT
- Appropriate error messages are returned if the specified CVE ID does not exist or if there are validation errors in the payload data.
- The database is an SQLite database named
cve_database.db. - The CSV file used for initial data import is named
CVE_DATABASE.csv. - The Flask application code is in
app.py. - The data import script is in
import_data.py.
For any issues or inquiries, please contact Hilal Ibrahim.